Skip to content

Component: <KeyboardInput />#509

Open
bryphe wants to merge 1 commit intomasterfrom
component/keyboard-input
Open

Component: <KeyboardInput />#509
bryphe wants to merge 1 commit intomasterfrom
component/keyboard-input

Conversation

@bryphe
Copy link
Member

@bryphe bryphe commented Jun 7, 2019

One thing that feels unnecessarily awkward today is to be able to just retrieve any keyboard input as a key event, from within a Revery app. This is important for games.

The <Calculator /> example actually has a component that handles this in a brute force way - it grabs focus on mount, and then listens for blur events, and steals the focus back. This helps in the case where a mouse click would 'blur'. This change brings this component to our API.

I believe there may also be a bug with our mouse-blur handling, where it blurs too aggressively - that might be worth looking at as a separate issue.

Open Issues:

  • What should we do in the case of multiple <KeyboardInput /> components? They'll ping-pong focus back and forth.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant